#! /bin/sh
# Shell: Smooth2 
# Example: smooth2 --- smooth a uniformly sampled 2D data set
# Author: John Stockwell, 1 Oct 1992

set -x

# use unisam2 to make uniformly sampled data
# See Unisam2 for details on how to use     unisam2
well1="10 10 40 40 30 30"
well2="10 10 40 40 30 30"
well3="10 10 40 40 30 30"
well4="10 10 40 40 30 30"
well5="10 10 40 40 30 30" 
well6="10 10 40 40 30 30"

rm junkv

# echo all the values as a single column of data in junkv
for i in $well1 $well2 $well3 $well4 $well5 $well6
do
	echo $i  >> junkv
done

a2b < junkv n1=1 > infile.v
unisam2 < infile.v x1=0,40,41,120,121,200 n1=200 \
		   x2=0,20,40,60,80,100 n2=100 d1=1 \
		   d2=1 > junk.data

#psimage < junk.data n1=200 n2=100 title="Unsmoothed data" \
#       label1="x1 direction" label2="x2 direction" | open 

#ximage < junk.data n1=200 n2=100 title="Unsmoothed data" \
#       label1="x1 direction" label2="x2 direction" &

smooth2 <  junk.data n1=200 n2=100 r1=10 r2=10  > junk.smooth

#psimage < junk.smooth n1=200 n2=100 title="Smoothed data" \
#       label1="x1 direction" label2="x2 direction" | open 

#ximage < junk.data n1=200 n2=100 title="Smoothed data" \
#       label1="x1 direction" label2="x2 direction" &
